import request from '@/utils/request'

export function showCouponFreeList(query) {
  return request({
    url: '/coupon/free/show',
    method: 'get',
    params: query
  })
}

export function removeCouponFree(couponId) {
  return request({
    url: '/coupon/free/remove',
    method: 'get',
    params: { 'couponId': couponId }
  })
}

export function saveAndSendCouponFree(data) {
  return request({
    url: '/coupon/free/send',
    method: 'post',
    data
  })
}

export function saveAndSendCouponShop(data) {
  return request({
    url: '/coupon/shop/send',
    method: 'post',
    data
  })
}

export function showCouponShopList(query) {
  return request({
    url: '/coupon/shop/show',
    method: 'get',
    params: query
  })
}

export function removeCouponShop(couponId) {
  return request({
    url: '/coupon/shop/remove',
    method: 'get',
    params: { 'couponId': couponId }
  })
}

export function saveCoupon(data) {
  return request({
    url: '/coupon/save',
    method: 'post',
    data
  })
}

export function getCoupon(query) {
  return request({
    url: '/coupon/get',
    method: 'get',
    params: query
  })
}
